pub mod user;
pub mod chat;
pub mod workspace;
pub mod messages;
pub mod file;

pub use chat::CreateChat;
pub use messages::{CreateMessage, ListMessages};
use serde::{Deserialize, Serialize};
pub use user::{CreateUser,SignUser};

use chrono::{DateTime, Utc};


#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChatFile {
    pub ws_id: u64,
    pub ext: String, // extract ext from filename or mime type
    pub hash: String,
}

//返回时返回fullname省的查询了
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct UserMessage{
    pub id: i64,
    pub chat_id: i64,
    pub sender_id: i64,
    pub content: String,
    pub files: Vec<String>,
    pub created_at: DateTime<Utc>,
    pub fullname: String,
}